import EnhancedMarkdownToWordConverter from './md-to-word-converter-enhanced.js';

async function convertSingleFile() {
    const converter = new EnhancedMarkdownToWordConverter();
    
    // 从命令行参数获取文件路径
    const filePath = process.argv[2];
    const outputName = process.argv[3];
    
    if (!filePath) {
        console.log('使用方法: node convert-single.js <markdown文件路径> [输出文件名]');
        console.log('示例: node convert-single.js ./docs/basics/overview.md "系统规划与管理师概述"');
        console.log('或者使用: npm run convert <markdown文件路径> [输出文件名]');
        return;
    }
    
    try {
        const outputPath = await converter.convertFile(filePath, outputName);
        console.log(`🎉 转换成功！输出文件: ${outputPath}`);
    } catch (error) {
        console.error('❌ 转换失败:', error.message);
        process.exit(1);
    }
}

convertSingleFile(); 